function register (context) {
  return context.keys().map(path => {
    return context(path).default
  })
}

const routeData = register(require.context('../modules', true, /routes\.js$/))

export const routes = routeData.reduce((collector, data) => {
  return collector.concat(data)
}, [])
